<%-- 
    Document   : basicsearch
    Created on : Apr 3, 2012, 11:30:19 PM
    Author     : anusha
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body bgcolor="gray"><center>
     <font size="55" color="blue" face="times new roman"><u>Basic Search</u><hr/> </font><br><br><br><br>
    
    Enter Keyword: <input type="text" name="keyword" value="" /><br><br>
    <input type="submit" value="Search" />&nbsp;&nbsp;<a href="studentwelcome.jsp"><input type="submit" value="Home" /></a>
    <%@ page import="java.sql.*" %>
    <html>
    <form>
    <table>
    <%
    String value=request.getParameter("id");
    int v=Integer.parseInt(value);
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root", "root");
    Statement st=conn.createStatement();
    ResultSet rs = st.executeQuery("select * from employee where id="+v+"");
    if(rs.next()){ 
        %>
    <tr><td>Name: </td><td<input type="text" value="<%=rs.getString("name")%>" > </td></tr>
    <tr><td>Address: </td><td<input type="text" value="<%=rs.getString("address")%>" > </td></tr>
    <tr><td>Contact No: </td><td<input type="text" value="<%=rs.getInt("contactNo")%>" > </td></tr>
    <tr><td>Email: </td><td<input type="text" value="<%=rs.getString("email")%>" > </td></tr>
          <%
    }
    %>
    </table>
    </form>
</html>
    </center>
    </body>
</html>
